const { application } = require('express');
const express = require('express');
const app= express()


app.get('/',(req, res) => {
  res.send({bookname:'三国演义',author:'罗贯中'})
})
app.post('/addBook',(req, res) => {
  res.send('添加图书成功')
})
app.get('/getQuery',(req, res) => {
  res.send(req.query)
})
app.get('/getParams/:id/:name',(req, res) => {
  res.send(req.params)
})
app.listen(8080,()=>{
  console.log('My server is running in http://localhost:8080');
})